<style>
    /* 根据字数修改 */
    .layui-form-label {
        width: 130px;
    }

    .layui-form-item .layui-input-inline {
        width: 240px;
    }
</style>
<div class="layuimini-container layuimini-page-anim">
    <!-- 用于创建子页面 -->
    <div class="page-create"></div>

    <!-- page-main-create -->
    <!-- 用于显示 隐藏 -->
    <div class="layuimini-main page-main-create">
        <div class="title-row layuimini-title ">
            <div class="title-left">
                <h4><span>计时工单人员信息</span></h4>
            </div>
            <div class="title-right">
                <span class="title-right-text">
                   
                    <button class="layui-btn layui-btn-primary layui-btn-sm" lay-on="download">
                        导出
                    </button>
                </span>
            </div>
        </div>


        <div class="m-df">
            <form class="layui-form" action="" lay-filter="search-form">
                <div class="layui-form-item">
                    <div class="search-box-wrapper">
                        <div class="search-box-body">
                            <div class="layui-inline">
                                <label class="layui-form-label">名称</label>
                                <div class="layui-input-inline">
                                    <input type="text" placeholder="请输入" name="name" autocomplete="off"
                                        class="layui-input">
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label">岗位</label>
                                <div class="layui-input-inline">
                                    <select class="layui-input" lay-append-to="body" placeholder="请选择"
                                        name="businessNames" lay-search>
                                        <option value="1">未完成</option>
                                        <option value="2">已完成</option>
                                    </select>

                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">人员等级</label>
                                <div class="layui-input-inline">
                                   <select class="layui-input" lay-append-to="body" placeholder="请选择"
                                        name="businessNames" lay-search>
                                        <option value="1">新手</option>
                                        <option value="2">老手</option>
                                        <option value="2">熟手</option>
                                    </select>
                                </div>
                            </div>
                         
                        </div>
                        <div class="search-box-btns">
                            <button type="submit" class="layui-btn layui-btn-sm" lay-submit
                                lay-filter="data-search-btn">查询</button>
                            <button type="reset" class="layui-btn  layui-btn-sm layui-btn-primary">重置</button>
                        </div>
                    </div>
                </div>
            </form>
        </div>


        <div class="section table-stripe">
            <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
        </div>
      
    </div>
</div>
<script>
    layui.use(['form', 'table', 'tabs', 'miniPage', 'element'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table,
            tabs = layui.tabs,
            laydate = layui.laydate,
            layer = layui.layer,
            util = layui.util,
            element = layui.element,
            miniPage = layui.miniPage;
        /******************** 事件 start ********************/

        util.on('lay-on', {
            //新增
            'add': function () {
                miniPage.renderPageCreate('page/accumulatedWorkOrder/accumulatedManager/components/timeCreditsAdd.html')
            },
            'download': function () {
                console.log('导出==')

            }
        })
        /******************** 事件 end ********************/



        /******************** 渲染组件 start ********************/
        form.render('select'); //刷新select选择框渲染
        // 起始日期
        laydate.render({
            elem: '#date_period_start',
            range: true
        });
        // 起始日期
        laydate.render({
            elem: '#date_period',
            range: true
        });
        /******************** 渲染组件 end ********************/

        table.render({
            elem: '#currentTableId',
            url: 'api/table.json',
            cols: [[
                { type: 'numbers', align: 'center', width: 80, title: '序号' },

                { field: 'name', align: 'center', minWidth: 100, title: '姓名' },
                { field: 'name', align: 'center', minWidth: 100, title: '岗位' },
                { field: 'name', align: 'center', minWidth: 100, title: '人员等级' },
                { field: 'name', align: 'center', minWidth: 100, title: '计时工单接单数(累计)' },
                { field: 'time', align: 'center', minWidth: 100, title: '接单工时(累计)' },
                { field: 'name', align: 'center', minWidth: 100, title: '有效接单工时(累计)	' },
                { field: 'name', align: 'center', minWidth: 100, title: '积分所得(累计)' },
            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 10,
            page: true,
            skin: 'grid',
            size: 'lg'
        });
   

        // 监听搜索操作
        form.on('submit(data-search-btn)', function (data) {
            var result = JSON.stringify(data.field);
            layer.alert(result, {
                title: '最终的搜索信息'
            });

            //执行搜索重载
            table.reload('currentTableId', {
                page: {
                    curr: 1
                }
                , where: {
                    searchParams: result
                }
            }, 'data');

            return false;
        });




        // 开启监听 折叠展开事件
        miniPage.listen()

    });
</script>